package com.morehair.controller.wx;

import com.morehair.bean.pojo.Brand;
import com.morehair.bean.vo.admin.BaseRespVo;
import com.morehair.bean.vo.wx.BrandVo;
import com.morehair.bean.vo.wx.WxBrandDataVo;
import com.morehair.service.wx.WxBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author  kkw
 * Date  2021/6/9 14:27
 * Version 1.0
 * Description :
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {
    @Autowired
    WxBrandService wxBrandService;

    @GetMapping("detail")
    public BaseRespVo brandDetail(Integer id) {
        Brand brand=wxBrandService.getBrandDetailById(id);
        return BaseRespVo.ok(new WxBrandDataVo(brand));
    }

    @GetMapping("list")
    public BaseRespVo brandList(Integer page, Integer size) {
        BrandVo brandVo=wxBrandService.getBrandList(page,size);
        return BaseRespVo.ok(brandVo);
    }
}
